package com.kancy.framework.job.starter.job;

import com.dangdang.ddframe.job.api.ShardingContext;

/**
 * ShardingContext 分片上下文Holder
 * @author kancy
 */
class ShardingContextHolder {
    private static final ThreadLocal<ShardingContext> shardingContextThreadLocal = new ThreadLocal();

    public void set(ShardingContext shardingContext) {
        shardingContextThreadLocal.set(shardingContext);
    }
    public void remove() {
        shardingContextThreadLocal.remove();
    }
    public final ShardingContext get() {
        return shardingContextThreadLocal.get();
    }
}
